<?php include("../config.php"); ?>

<html>
<head>
<title><?php echo($name); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

</head>
<body>
<h1><?php echo($name); ?></h1>
<?php
if(empty($_SESSION['login'])) {
echo("<h3>Connectez-vous pour voir cette page!");
}

else {

$id = $_POST['id'];
dbconnect();
$req = mysql_query("SELECT * FROM ".$prefix."url WHERE `key` = ".$id." LIMIT 1");
$data = mysql_fetch_assoc($req);
if($_SESSION['login'] != $data['owner']) {
echo("<p>Vous n'Ãªtes pas le propriÃ©taire de cette URL</p>");
}
else {

mysql_query("UPDATE `".$prefix."url` SET `url` = '".$_POST['newurl']."' WHERE `key` = ".$id." LIMIT 1;");
echo(mysql_error());
echo("OK");
?>
<p><a href="./links.php">Retour</a></p>
<?php
}
}
?>
